#include <iostream>

#include "ros/ros.h"
#include "demo/Login.h"

int main(int argc, char* argv[]) {
    std::string nodeName = "Client";
    ros::init(argc, argv, nodeName);
    ros::NodeHandle nodeHandle;
    std::string serviceName = "demo4";
    ros::ServiceClient serviceClient = nodeHandle.serviceClient<demo::Login>(serviceName); // 创建客户端
    demo::Login service; // 创建服务
    service.request.username = "admin";
    service.request.password = "admin";
    serviceClient.call(service); // 请求服务
    ROS_INFO("Response: %s", service.response.result.c_str());

    return EXIT_SUCCESS;
}